#include <STC89C5xRC.H>
#include <INTRINS.H>


//端口
sbit buzzer = P2^5;

//蜂鸣器私有延时函数，延时500ms
void buzzer_Delay500us(void)	//@11.0592MHz
{
	unsigned char data i;

	_nop_();
	i = 227;
	while (--i);
}

//蜂鸣器发声ms毫秒
void buzzer_time(unsigned char ms)
{
	unsigned int i;
	for(i = 0;i<ms*2;i++)
	{
		buzzer = !buzzer;
		buzzer_Delay500us();
	}
}
